package routers

import (
	"Sales_system/control"
	"github.com/gin-gonic/gin"
)

func orderRouter(r *gin.RouterGroup)  {
	r.GET("/order", control.Getorder) //查询
	r.POST("/order",control.Addorder) //添加
	r.DELETE("/order", control.Delorder) //删除
	r.PUT("/order",control.Updatelorder) //更新
}

func detailsRouter(r *gin.RouterGroup)  {
	r.GET("/details", control.Getdetails) //查询
	r.POST("/details",control.Adddetails) //添加
	r.DELETE("/details", control.Updatedetails) //删除
	r.PUT("/details",control.Deldetails) //更新
}

func consumerRouter(r *gin.RouterGroup)  {
	r.GET("/consumer",control.Getconsumer)
	r.POST("/consumer",control.Addconsumer)
	r.PUT("/consumer",control.Updateconsumer)
	r.DELETE("/consumer",control.Delconsumer)
}

func goodsRouter(r *gin.RouterGroup)  {
	r.GET("/goods",control.Getgoods)
	r.POST("/goods",control.Addgoods)
	r.PUT("/goods",control.Updategoods)
	r.DELETE("/goods",control.Delgoods)
}

func classRouter(r *gin.RouterGroup)  {
	r.GET("/class",control.GetgoodsClass)
	r.POST("/class",control.AddgoodsClass)
	r.PUT("/class",control.UpdategoodsClass)
	r.DELETE("/class",control.DelgoodsClass)
}

func factoryRouter(r *gin.RouterGroup)  {
	r.GET("/factory",control.Getfactory)
	r.POST("/factory",control.Addfactory)
	r.PUT("/factory",control.Updatefactory)
	r.DELETE("/factory",control.Delfactory)
}

func getbill(r *gin.RouterGroup)  {
	r.GET("/bill", control.Getbill)
}